//
//  DataHandle.h
//  BTRIP
//
//  Created by Rain on 15/11/12.
//  Copyright © 2015年 johnbk. All rights reserved.
//

#import "BaseObject.h"
#import <UIKit/UIKit.h>

typedef void (^ContectionBlock)(id response);

typedef NS_ENUM(NSUInteger, ResposeStyle) {
    JSON,
    XML,
    Data,
};

@interface DataHandle : BaseObject

+ (void)contectWithURL:(NSString *)url andParameters:(NSDictionary *)parameters andViewController:(UIViewController *)viewController andBlock:(ContectionBlock)block;

+ (void) getUrl:(NSString *)url
           body:(id)body
       response:(ResposeStyle)style
requestHeadFile:(NSDictionary *)headFile
 viewController:(UIViewController *)viewController
        success:(void (^)(NSURLSessionDataTask *task, id resposeObject))success
        failure:(void (^)(NSURLSessionDataTask *task, NSError *error)) failure;

@end
